package org.tgit.gateway.common;

/**
 * 
 * @ClassName: ApiMonitor
 * @Description: TODO(Api-监控数据对象)
 * @author fanzaijun
 * @date 2018年8月23日 下午5:21:42
 *
 */
public class ApiMonitorData {
	// 访问URI
	private String accessUri;
	// APPCode
	private String appCode;
	// APIID
	private String apiId;
	// 日志ID
	private String logId;
	// 接口调用开始时间
	private long beginAccTime=0l;
	// 接口调用结束时间
	private long endAccTime=0l;
	// 接口调用耗时
	private long costTime=0l;
	// 接口调用返回码
	// 200-正常，404-未找到，405-状态允许，401-api未授权
	private String returnCode="200";
	// 请求的IP地址
	private String reqIp;
	// 请求的Token
	private String reqAccessToken;
	// 转发的部署URI
	private String rewriteDeployUrl;
	// 真实接口返回
	// 100-API未注册，101-API关闭，102-API使用时间过期，103-API未启用,
	// 104-API所有服务器为空,105-apiId为空,106-部署url为空，107-请求体的数据为空,
	// 108-鉴权信息为空，109-鉴权信息不存在或者不匹配
	private String reqErrorCode;
	// 接口需要的真实Token
	private String accessToken;

	public String getAppCode() {
		return appCode;
	}

	public void setAppCode(String appCode) {
		this.appCode = appCode;
	}

	public String getApiId() {
		return apiId;
	}

	public void setApiId(String apiId) {
		this.apiId = apiId;
	}

	public String getLogId() {
		return logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}

	public long getBeginAccTime() {
		return beginAccTime;
	}

	public void setBeginAccTime(long beginAccTime) {
		this.beginAccTime = beginAccTime;
	}

	public long getEndAccTime() {
		return endAccTime;
	}

	public void setEndAccTime(long endAccTime) {
		this.endAccTime = endAccTime;
	}

	public long getCostTime() {
		return this.costTime;
	}

	public void setCostTime(long costTime) {
		this.costTime = costTime;
	}

	public String getReturnCode() {
		return returnCode;
	}

	public void setReturnCode(String returnCode) {
		this.returnCode = returnCode;
	}

	public String getReqIp() {
		return reqIp;
	}

	public void setReqIp(String reqIp) {
		this.reqIp = reqIp;
	}

	public String getReqAccessToken() {
		return reqAccessToken;
	}

	public void setReqAccessToken(String reqAccessToken) {
		this.reqAccessToken = reqAccessToken;
	}

	public String getRewriteDeployUrl() {
		return rewriteDeployUrl;
	}

	public void setRewriteDeployUrl(String rewriteDeployUrl) {
		this.rewriteDeployUrl = rewriteDeployUrl;
	}

	public String getReqErrorCode() {
		return reqErrorCode;
	}

	public void setReqErrorCode(String reqErrorCode) {
		this.reqErrorCode = reqErrorCode;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	public String getAccessUri() {
		return accessUri;
	}

	public void setAccessUri(String accessUri) {
		this.accessUri = accessUri;
	}

	@Override
	public String toString() {
		return "本地请求日志: [accessUri=" + accessUri + ", appCode=" + appCode + ", apiId=" + apiId + ", logId="
				+ logId + ", beginAccTime=" + beginAccTime + ", endAccTime=" + endAccTime + ", costTime=" + costTime
				+ ", returnCode=" + returnCode + ", reqIp=" + reqIp + ", reqAccessToken=" + reqAccessToken
				+ ", rewriteDeployUrl=" + rewriteDeployUrl + ", reqErrorCode=" + reqErrorCode + ", accessToken="
				+ accessToken + "]";
	}
	
}
